<template>
	<view class="city">
		<change-header></change-header>
		<!-- :city="city" 传递城市名字大写字母 -->
		<change-list  :letter="letter" :city="city" ></change-list>
		<change-alphabet  @change="change" :city="city"></change-alphabet>
	</view>
</template>

<script>
	import changeHeader from '../../components/changeHeader.vue'
	import changeList from '../../components/changeList.vue'
	import changeAlphabet from '../../components/changeAlphabet.vue'
	export default {
		components:{
			changeHeader,
			changeList,
			changeAlphabet
		},
		data() {
			return {
				city:[],
				letter:[]
				
			}
		},
		methods: {
			getCityInfo(){
				uni.request({
					// 请求城市名字
					url:'http://124.221.26.166:8080/videos/city.json',
					success:(res) => {
						// console.log(res.data)
						this.city=res.data.city
						// console.log(this.city)
					}
				})
			},
			// 监听点击字母事件
			change(res){
				// console.log(res)
				this.letter=res
			}
		},
		created(){
			this.getCityInfo()
		}
	}
	
</script>

<style>
	.city{
		width: 100%;
		background: #000000;
		height: 100%;
	}

</style>
